@extends('admin.common')
@section('head')
    @yield('c-head')
@stop
@section('body')

    <header class="am-topbar admin-header am-topbar-fixed-top">
        <div class="am-topbar-brand">
            <strong>后谷咖啡-管理页面 </strong> <small></small>
        </div>

        <div class="top-info">
            <div class="login-info">
                <i class="icon-user"> </i>
                <span>您好:</span>
                <a style="color:red;">{{ Admin::user()->user }}</a>
            </div>

            <a class="link-action">更新缓存</a>
            <a class="link-action" href="{{ route('admin.logout') }}">退出</a>
            <a class="link-action" href="/" target="_blank">商城首页</a>
        </div>

    </header>

    <div class="am-cf admin-main">
        <!-- sidebar start -->
        <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
            <div class="am-offcanvas-bar admin-offcanvas-bar">
                <ul class="am-list admin-sidebar-list">
                    @foreach($navs as $nav)
                        @include('admin.common.sub-nav', ['nav' => $nav])
                    @endforeach
                </ul>

            </div>
        </div>
        <!-- sidebar end -->

        <!-- content start -->
        <div class="admin-content">

            <hr>

            @yield('c-body')
        </div>
        <!-- content end -->

    </div>

    <a href="#" class="am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}">
        <span class="am-icon-btn am-icon-th-list"></span>
    </a>
@stop
@section('foot')
    <script>
        (function ($) {
            'use strict';

            $(function () {
                var $fullText = $('.admin-fullText');
                $('#admin-fullscreen').on('click', function () {
                    $.AMUI.fullscreen.toggle();
                });

                $(document).on($.AMUI.fullscreen.raw.fullscreenchange, function () {
                    $fullText.text($.AMUI.fullscreen.isFullscreen ? '退出全屏' : '开启全屏');
                });
            });
        })(jQuery);
    </script>

    @yield('c-foot')
@stop